﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Mads.CoreDomain;

namespace CassirApp
{
  public partial class Ticket1 : Form
  {
    public Station[] massiveOfStations;
    public TrainManagerClient client = new TrainManagerClient();
    public int sessionId;
    public DateTime date;
    public string startPoint;
    public string finishPoint;

    public Ticket1(int id)
    {
      InitializeComponent();

      sessionId = id;
      massiveOfStations = client.GetStations(sessionId);
      startBox.Items.Clear();
      finishBox.Items.Clear();
      foreach (Station station in massiveOfStations)
      {
        startBox.Items.Add(station.Name);
        finishBox.Items.Add(station.Name);
      }
    }

    private void button1_Click(object sender, EventArgs e)
    {
      date = dateTimePicker1.Value;
      string dateString = date.ToString();
      startPoint = startBox.Text;
      finishPoint = finishBox.Text;
      Ticket2 form = new Ticket2(this, sessionId);
      form.Show();
    }
  }
}
